using System;
using System.Collections.Generic;
using System.Text;

namespace DigitalFortress.Configuration {
	/// <summary>
	/// The configuration in the appContext config file (app.config or web.config).
	/// </summary>
	public class XmlConfiguration : IConfiguration {

		/// <summary>
		/// Gets the configuration from the current AppContext config file.
		/// </summary>
		public static IConfiguration Current {
			get {
				return System.Configuration.ConfigurationManager.GetSection("digitalfortress") as IConfiguration;;
			}
		}

		#region IConfigurationSectionHandler Members

		/// <summary>
		/// Parses the digitalfortress config section.
		/// </summary>
		/// <param name="parent">Parent node.</param>
		/// <param name="configContext">Configuration Context.</param>
		/// <param name="section">Section being parsed.</param>
		/// <returns>Returns the configured section.</returns>
		public object Create(object parent, object configContext, System.Xml.XmlNode section) {
			return this;
		}

		#endregion
	}
}
